<?php if(!defined('IN_KKFRAME')) exit('Access Denied'); ?>
<?php include template('header'); ?>
	<div class="container">
		<ul class="breadcrumb">
			<li><a href="./"><i class="icon-home"></i></a> <span class="divider">/</span></li>
			<li class="active">我的歌曲</li>
		</ul>
		<div class="row-fluid">
			<div class="span12">
				<table class="table table-striped hidden-phone">
					<thead>
						<th>#</th>
						<th>标题</th>
						<th>艺术家</th>
						<th>专辑</th>
						<th>状态</th>
						<th>品质</th>
						<th>存储服务商</th>
						<th>操作</th>
					</thead>
					<tbody>
					<?php if($songs){ ?>
						<?php foreach($songs as $song){ ?>
						<tr>
							<td><?php echo $song['id']; ?></td>
							<td><?php echo $song['title']; ?></td>
							<td><?php echo $song['artist']; ?></td>
							<td><?php echo $song['album']; ?></td>
							<td>
								<?php if($song['status']=='1'){ ?><span class="label label-important">待提交</span>
								<?php }elseif($song['status']=='2'){ ?><span class="label label-warning">待审核</span>
								<?php }elseif($song['status']=='3'){ ?><span class="label label-success">审核通过</span>
								<?php }elseif($song['status']=='4'){ ?><span class="label label-info">高音质待审</span>
								<?php }else{ ?><span class="label label-inverse">未知</span><?php } ?>
							</td>
							<td>
								<?php if($song['type']=='1'){ ?><span class="badge"><?php if(getSetting('quality_1')){ echo getSetting('quality_1'); }else{ ?>渣音质<?php } ?></span>
								<?php }elseif($song['type']=='2'){ ?><span class="badge badge-success"><?php if(getSetting('quality_2')){ echo getSetting('quality_2'); }else{ ?>高音质<?php } ?></span>
								<?php }elseif($song['type']=='3'){ ?><span class="badge badge-info"><?php if(getSetting('quality_3')){ echo getSetting('quality_3'); }else{ ?>无损<?php } ?></span>
								<?php }else{ ?><span class="badge badge-inverse">未知</span><?php } ?>
							</td>
							<td>
								<?php if($song['fileserver_type']=='vdisk'){ ?><span class="label label-info">威盘</span>
								<?php }elseif($song['fileserver_type']=='baidupcs'){ ?><span class="label label-info">百度云</span>
								<?php }else{ ?><span class="label label-inverse">未知</span><?php } ?>
							</td>
							<td>
							<?php if($song['status']=='3'){ ?>
								<?php if($song['type']!='3'){ ?>
									<a class="btn btn-mini btn-primary" onclick="prompt('歌曲 <?php echo $song['title']; ?> 的外链:', '<?php echo $_config['siteurl']; ?>/file/link/<?php echo $uid; ?>/<?php echo $song['id']; ?>.mp3');">外链</a>
									<a class="btn btn-mini btn-success" onclick="window.open('play.swf?src=<?php echo $_config['siteurl']; ?>/file/link/<?php echo $uid; ?>/<?php echo $song['id']; ?>.mp3&auto_play=true','newwindow','height=400,width=700,top=200,left=200,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no')">试听</a>
								<?php } ?>
								<a class="btn btn-mini btn-primary" href="my.php?action=edit&id=<?php echo $song['id']; ?>">修改</a>
								<a class="btn btn-mini" href="file/link/<?php echo $uid; ?>/<?php echo $song['id']; ?>.mp3" target="_blank">下载</a>
								<a class="btn btn-mini btn-danger" onclick="if(!confirm('确认要删除吗？')) return false;" href="my.php?action=delete&id=<?php echo $song['id']; ?>">删除</a>
							<?php }elseif($song['status']=='2'){ ?>
								<a class="btn btn-mini btn-primary" href="my.php?action=edit&id=<?php echo $song['id']; ?>">修改</a>
								<a class="btn btn-mini btn-danger" onclick="if(!confirm('确认要删除吗？')) return false;" href="my.php?action=delete&id=<?php echo $song['id']; ?>">删除</a>
							<?php }elseif($song['status']=='1'){ ?>
								<a class="btn btn-mini btn-primary" href="my.php?action=edit&id=<?php echo $song['id']; ?>">提交</a>
								<a class="btn btn-mini btn-danger" onclick="if(!confirm('确认要删除吗？')) return false;" href="my.php?action=delete&id=<?php echo $song['id']; ?>">删除</a>
							<?php } ?>
							</td>
						</tr>
						<?php } ?>
					<?php }else{ ?>
						<td colspan="8">没有查询到数据</td>
					<?php } ?>
					</tbody>
				</table>
				<div class="visible-phone">
					<?php if($songs){ ?>
						<?php foreach($songs as $song){ ?>
						<div id="song-<?php echo $song['id']; ?>">
							<h5><?php echo $song['title']; ?>&nbsp;<small><?php echo $song['artist']; ?></small></h5>
							<p>来自专辑：<?php echo $song['album']; ?></p>
							<p>
								<?php if($song['status']=='1'){ ?><span class="label label-important">待提交</span>
								<?php }elseif($song['status']=='2'){ ?><span class="label label-warning">待审核</span>
								<?php }elseif($song['status']=='3'){ ?><span class="label label-success">审核通过</span>
								<?php }elseif($song['status']=='4'){ ?><span class="label label-info">高音质待审</span>
								<?php }else{ ?><span class="label label-inverse">未知</span><?php } ?>

								<?php if($song['type']=='1'){ ?><span class="badge"><?php if(getSetting('quality_1')){ echo getSetting('quality_1'); }else{ ?>渣音质<?php } ?></span>
								<?php }elseif($song['type']=='2'){ ?><span class="badge badge-success"><?php if(getSetting('quality_2')){ echo getSetting('quality_2'); }else{ ?>高音质<?php } ?></span>
								<?php }elseif($song['type']=='3'){ ?><span class="badge badge-info"><?php if(getSetting('quality_3')){ echo getSetting('quality_3'); }else{ ?>无损<?php } ?></span>
								<?php }else{ ?><span class="badge badge-inverse">未知</span><?php } ?>

								<?php if($song['fileserver_type']=='vdisk'){ ?><span class="label label-info">威盘</span>
								<?php }elseif($song['fileserver_type']=='baidupcs'){ ?><span class="label label-info">百度云</span>
								<?php }else{ ?><span class="label label-inverse">未知</span><?php } ?>
							</p>
							<p>
							<?php if($song['status']=='3'){ ?>
								<?php if($song['type']!='3'){ ?>
									<a class="btn btn-mini btn-primary" onclick="prompt('歌曲 <?php echo $song['title']; ?> 的外链:', '<?php echo $_config['siteurl']; ?>/file/link/<?php echo $uid; ?>/<?php echo $song['id']; ?>.mp3');">外链</a>
									<a class="btn btn-mini btn-success" target="_blank" href="html5player.php?name=<?php echo $song['title']; ?>&src=<?php echo $_config['siteurl']; ?>/file/link/<?php echo $uid; ?>/<?php echo $song['id']; ?>.mp3">试听</a>
								<?php } ?>
								<a class="btn btn-mini btn-primary" href="my.php?action=edit&id=<?php echo $song['id']; ?>">修改</a>
								<a class="btn btn-mini" href="file/link/<?php echo $uid; ?>/<?php echo $song['id']; ?>.mp3" target="_blank">下载</a>
								<a class="btn btn-mini btn-danger" onclick="if(!confirm('确认要删除吗？')) return false;" href="my.php?action=delete&id=<?php echo $song['id']; ?>">删除</a>
							<?php }elseif($song['status']=='2'){ ?>
								<a class="btn btn-mini btn-primary" href="my.php?action=edit&id=<?php echo $song['id']; ?>">修改</a>
								<a class="btn btn-mini btn-danger" onclick="if(!confirm('确认要删除吗？')) return false;" href="my.php?action=delete&id=<?php echo $song['id']; ?>">删除</a>
							<?php }elseif($song['status']=='1'){ ?>
								<a class="btn btn-mini btn-primary" href="my.php?action=edit&id=<?php echo $song['id']; ?>">提交</a>
								<a class="btn btn-mini btn-danger" onclick="if(!confirm('确认要删除吗？')) return false;" href="my.php?action=delete&id=<?php echo $song['id']; ?>">删除</a>
							<?php } ?>
							</p>
						</div>
						<hr>
						<?php } ?>
					<?php }else{ ?>
						<div class="alert alert-info"><strong>提示</strong> 没有查询到数据</div>
					<?php } ?>
				</div>
				<div class="text-right"><?php echo $Page->show(); ?></div>
			</div>
		</div>
	</div>
<?php include template('footer'); ?>